package com.acxy.common;

import java.util.HashMap;
import java.util.Map;

/**
 * 简单的封装支付返回
 * @author MrShun
 * @version 1.0
 * @Date 2017-11-05
 */
public class ApiResult extends HashMap{

    private boolean ok;

    private Object msg;

    public ApiResult(Map map){
        super(map);
        if (get("errcode") != null) {
            ok = false;
            msg = get("errmsg");
        }else
            ok = true;
    }

    public boolean isOk(){
        return ok;
    }

    public Object getMsg() {
        return msg;
    }

    public String getStr(String key){
        return String.valueOf(get(key));
    }
}
